﻿@if (Value is DateTime dateTime)
{
    <DateTimeListItem Value="@dateTime.Add(JsInitVariables.TimezoneOffset)" />
}
else if (Value is DateTimeOffset dateTimeOffset)
{
    <DateTimeListItem Value="@dateTimeOffset.ToOffset(JsInitVariables.TimezoneOffset)" />
}
else
{
    if(Width != null)
    {
        <div class="body regular--text" style="@($"max-width:{(Width.IsT0? Width.AsT0 : Width.AsT1 + "px")}")">
            @Value
        </div>
    }
    else
    {
        <div class="body regular--text">@Value</div>
    }
}

@code {
    [Parameter]
    public object? Value { get; set; }

    [Parameter]
    public StringNumber? Width { get; set; }

    [Inject]
    public JsInitVariables JsInitVariables { get; set; } = default!;
}
